<include file="Public:wapheader" />
	<div class="cd-user-modal is-visible"> 
		<div class="cd-user-modal-container">
			<ul class="cd-switcher">
				<li><a href="#0">用户登录</a></li>
				<li><a href="#0">注册新用户</a></li>
			</ul>

			<div id="cd-login"> <!-- 登录表单 -->
				<form name="" action="{:U('login/login')}" method="post" class="cd-form">
					<p class="fieldset">
						<label class="image-replace cd-username" for="signin-username">用户名</label>
						<input name="username" class="full-width has-padding has-border" id="signin-username" type="text" placeholder="输入用户名">
					</p>

					<p class="fieldset">
						<label class="image-replace cd-password" for="signin-password">密码</label>
						<input name="password" class="full-width has-padding has-border" id="signin-password" type="password"  placeholder="输入密码">
					</p>
					<p class="fieldset">
						<label class="image-replace cd-email" for="signin-password">码证码</label>
						<input name="code" class="has-padding has-border has-width" type="text"  placeholder="验证码">
						<span style="margin-left: 10px">
							<img width="30%" class="left15" height="30" alt="验证码" src="{:U('Wap/Login/verify_c',array())}" title="点击刷新">
						</span>
					</p>

					<p class="fieldset">
						<input type="checkbox" name="state" value="1" id="remember-me" checked>
						<label for="remember-me">记住登录状态</label>
					</p>

					<p class="fieldset">
						<input class="full-width2" type="submit" value="登 录">
					</p>
				</form>
			</div>

			<div id="cd-signup"> <!-- 注册表单 -->
				<form name="reg" action="{:U('login/reg')}" method="post" class="cd-form" id="reg">
					<p class="fieldset">
						<label class="image-replace cd-username" for="signup-username">用户名</label>
						<input name="username" class="full-width has-padding has-border required" id="signup-username" type="text" value="" placeholder="输入用户名">
					</p>

					<p class="fieldset">
						<label class="image-replace cd-email" for="signup-email">手机号</label>
						<input name="mobile" class="full-width has-padding has-border required ismobile" id="signup-email" type="number" value="" placeholder="手机号">
					</p>

					<p class="fieldset">
						<label class="image-replace cd-password" for="signup-password">密码</label>
						<input name="password" class="full-width has-padding has-border required" id="signup-password" type="password" value=""  placeholder="输入密码">
					</p>
					<p class="fieldset">
						<label class="image-replace cd-email" for="signin-password">码证码</label>
						<input name="code" class="has-padding has-border has-width" type="text"  placeholder="验证码">
						<span style="margin-left: 10px">
							<img width="30%" class="left15" height="30" alt="验证码" src="{:U('Wap/Login/verify_c',array())}" title="点击刷新">
						</span>
					</p>

					<p class="fieldset">
						<input name="state" type="checkbox" id="accept-terms" class="{required:true,min:1}" checked>
						<label for="accept-terms">我已阅读并同意 <a href="#0">用户协议</a></label>
					</p>

					<p class="fieldset">
						<input class="full-width2" type="submit" value="注册新用户">
					</p>
				</form>
			</div>
		</div>
	</div> 
</div>
</body>
<script src="__S__/js/jquery.validate.js"></script>
<script src="__S__/js/magess.js"></script>
<script src="__S__/js/jquery.metadata.js"></script>
<script type="text/javascript">
	$().ready(function() {
		$("#reg").validate();
		jQuery.validator.addMethod("ismobile", function(value, element) {
			var length = value.length;
			var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
			return this.optional(element) || (length == 11 && mobile.test(value));
		}, "非法手机号");
	});
</script>
<script>
	var captcha_img = $('.fieldset').find('img')
	var verifyimg = captcha_img.attr("src");
	captcha_img.attr('title', '点击刷新');
	captcha_img.click(function(){
		if( verifyimg.indexOf('?')>0){
			$(this).attr("src", verifyimg+'&random='+Math.random());
		}else{
			$(this).attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
		}
	});
</script>
</html>
